export const tableOption ={
  labelPosition: "left",
  labelSuffix: "：",
  labelWidth: 120,
  gutter: 0,
  menuBtn: true,
  align: "center",
  submitBtn: true,
  submitText: "提交",
  stripe: true,
  emptyBtn: true,
  emptyText: "清空",
  menuPosition: "center",
  border: true,
  index: true,
  indexLabel: "序号",
  addBtn: false,
  editBtn: false,
  delBtn: false,
  searchMenuSpan:8,
  menuWidth:100,
  searchEnter: true,
  column: [
    {
      type: "input",
      label: "产线名称",
      prop: "realityLineName",
      span: 12,
      search:true,
      searchLabelWidth: 100
    },
    {
      type: "select",
      label: "车间名称",
      prop: "workshopId",
      span: 12,
      dicUrl: "/admin-api/o3-pfoc/workshop/getWorkshopList",
      dicMethod: "get",
      props: {
        label: "workshopName",
        value: "id"
      },
      // search: true,
      /*searchslot:true,
      searchLabelWidth:100,*/
    },
    {
      type: "select",
      label: "产线类型",
      prop: "lineType",
      span: 12,
      dicData:[//产线类型列表
        {
          value: '手动线',
          label: '手动线'
        },
        {
          value: '自动线',
          label: '自动线'
        }
      ],
      search:true,
      searchLabelWidth: 100
    },
    {
      type: "input",
      label: "产线模板名称",
      prop: "lineTplName",
      span: 12,
    },
   /* {
      type: "input",
      label: "工序",
      prop: "processNodes",
      span: 12,
      overHidden: true,
      formatter:(row, value,column) => {
        var html="";
        const json = JSON.parse(value);
        for (var i=0;i<json.length;i++){
          html = html+json[i].name+";";
        }
        return html;
      }
    },
    {
      type: "input",
      label: "工序顺序",
      prop: "processNodeLine",
      span: 12,
      overHidden: true,
      formatter:(row, value,column) => {
        var html="";
        let  json = JSON.parse(value);
        const len = json.length
        for (let i = 0; i < len; i++) {
          for (let j = i+1; j < len; j++) {
            if ( json[i].from ==json[j].to ) {
              const temp = json[j]
              json[j] = json[i]
              json[i] = temp
            }
            if(json[i].to ==json[j].to){
              const temp = json[j]
              json[j] = json[i]
              json[i] = temp
            }
          }
        }

        let newArr =[];
        for(var i =0;i<json.length;i++){
          newArr.push(json[i].from)
          if(i==json.length-1) {
            newArr.push(json[i].to)
          }
        }
        let nameStr ="";
        const json2 = JSON.parse(row.processNodes);
        for(var n =0;n<newArr.length;n++){
          for (var m=0;m<json2.length;m++){
            if(newArr[n]==json2[m].id) {
              nameStr = nameStr + json2[m].name + ";";
            }
          }
        }

        return nameStr;
      }
    },*/
    {
      prop: "createBy",
      span: 12,
      type: "input",
      label: "发布人",
      dicUrl: "/admin/user/getAllUser",
      props: {
        label: "name",
        value: "username"
      },
      dicMethod: "get",
      display: false,
      hide:false,
    },
    {
      prop: "createTime",
      span: 12,
      type: "datetime",
      label: "发布时间",
      format: "yyyy-MM-dd HH:mm:ss",
      display: false,
      hide:false,
      valueFormat: "yyyy-MM-dd HH:mm:ss"
    },

  ]
}
